package cn.majingjing.demo.aop.services;

import cn.majingjing.demo.aop.config.LogToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;

/**
 * @author JingjingMa
 * @date 2019/10/30 16:15
 */
@Service
public class LogService2 {
    Logger log = LoggerFactory.getLogger(LogService2.class);

    @LogToken
    public void method1() {
        log.info("hello method1");
    }

    @LogToken
    public void method2() {
        log.info("hello method2");
        ((LogService2) AopContext.currentProxy()).method1();
    }


}
